﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Gnosis.Babel;
using Gnosis.SQLite.Clauses;

namespace Gnosis.SQLite
{
    public class IntegerColumnName
        : IntegerValue, IIntegerColumnName
    {
        public IntegerColumnName(string name)
            : base(name)
        {
            _name = name;
        }

        public IntegerColumnName(string name, string alias)
            : base(string.Format("{0} AS {1}", name, alias))
        {
            _name = name;
        }

        private readonly string _name;

        public IOrderingTerm Ascending()
        {
            return new OrderingTerm(this, Direction.Ascending);
        }

        public IOrderingTerm Descending()
        {
            return new OrderingTerm(this, Direction.Descending);
        }

        public IColumnAssignment SetTo(IValue value)
        {
            return new ColumnAssignment(this, value);
        }
    }
}
